<template>
	<view class="page">
		<view class="huanzheliebiao">
			<view class="huanzhe_item"
				v-for="(huanzhe, huanzhe_index) in zhenduan.list"
				:key="huanzhe.list_key"
			>
				<view class="album__content">
					<view class="line1">
						<view style="width: 500rpx;display: flex;justify-content: space-between;">
							<text>{{huanzhe.type==1?'前台医生已处理':'无医生'}}</text>
							<text>{{$u.timeFormat(timestamp, 'yyyy年mm月dd日')}}</text>
						</view>
						<view style="width: 100rpx;display: flex;">
							<u-button class="list_item_btn" size="mini" @click="goto_huanzhe_page(huanzhe.id)">查看</u-button>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import { get_zhenduan_list } from '@/util/api/api.js';
	
	export default {
		data() {
			return {
				url: "/index.php/html5/zhenduan/get_zhenduan_list",
				gettokenurl: "/index.php/html5/login/gettoken",
				zhenduan:{
					list:[],
					curpage:0
				},
				timestamp:0,
				tab:{
					list:[],
					current:1
				},
			}
		},
		onLoad() {
			this.tab.list = getApp().globalData.admin_tab_list
			this.get_zhenduan_list()
			// this.get_doc_list()
		},
		methods: {
			get_zhenduan_list(curpage=0,listnum=0){
				let that = this
				let data = {
					curpage:curpage,
					listnum:listnum
				}
				
				get_zhenduan_list(data).then((res)=>{
					console.log(res)
					
					if (res.code==200) {
						if(res.data.datalist){
							that.zhenduan.list.push(...res.data.datalist)
							that.zhenduan.curpage = res.data.pages
							that.zhenduan.curpage = res.data.total
						}
					} else{
						that.showToast(res.message)
					}
				})
			},
			goto_huanzhe_page(id){
				uni.navigateTo({
					url: '../fenpei/fenpei?id='+id
				});
			},
		}
	}
</script>
<style>
page{
	height: 100%;
	background: #F5F5F5;
}
.huanzhe_item{
	padding: 25rpx;
	margin: 25rpx;
	display: flex;
	background: #fff;
}
.album__avatar{
	width: 90rpx;
	height: 90rpx;
	border-radius: 50%;
}
.album__content{
	width: 100%;
}
.album__content text{
	font-size: 28rpx;
}
.line1{
	width: 100%;
	display: flex;
	justify-content: space-between;
}
.list_item_btn{
	width: 100rpx;
	height: 50rpx;
	background-color: #15BBA2;
	color: #fff;
	border-radius: 30rpx;
	margin: 0 10rpx;
}
</style>